package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.joysuch.wwyt.core.repository.BaseTypeGroupItemDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zero
 * @since 2021/11/18 16:23
 */
@Component
public class ExportRiskDistrictTypeConvertor implements FieldValueConvert<Long, String> {

    @Autowired
    private BaseTypeGroupItemDao baseTypeGroupItemDao;
    
    @Override
    public String convert(Object bean, Long value, DataDumpField dataField) {
        return baseTypeGroupItemDao.findNameByIdAndState(value);
    }
}
